package com.fg.cloud.manager.service.product.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fg.cloud.manager.entry.BaseEntity;
import com.fg.cloud.manager.entry.product.ProductParamEntity;
import com.fg.cloud.manager.mapper.BaseMapper;
import com.fg.cloud.manager.mapper.product.ProductParamMapper;
import com.fg.cloud.manager.service.BaseServiceImpl;
import com.fg.cloud.manager.service.product.ProductParamService;

/**
  * Description:商品参数接口实现
  * @author liushengchao
  * @date 2017年8月7日上午11:08:01
 */
@Service
public class ProductParamServiceImpl extends BaseServiceImpl implements ProductParamService{
	@Autowired
	private ProductParamMapper paramMapper ; 

	@Override
	protected <T extends BaseEntity> BaseMapper getBaseMapper() {
		return paramMapper;
	}

	/**
	 * 查询商品对应的参数列表
	 */
	@Override
	public List<ProductParamEntity> selectByProductId(Long productId) {
		return paramMapper.selectByProductId(productId);
	}

	/**
	 * 根据商品ID删除商品信息
	 */
	@Override
	@Transactional
	public int deleteByProduct(Long productId) {
		return paramMapper.deleteByProductId(productId);
	}

}
